<p class="Paragraph">VarName: Any variable name or array name.</p>
<p class="Paragraph">Start, End: Numeric values or constants ranging from -32768 to 32767 that define the number of elements (NumberElements=(end-start)+1) and the index range.</p>
<p class="Paragraph">start and end can be numeric expressions if ReDim is used at the procedure level.</p>
<p class="Paragraph">VarType: Key word used to declare the data type of a variable.</p>
<p class="Paragraph">Long: Long integer variable (-2,147,483,648 - 2,147,483,647)</p>
<p class="Paragraph">Object: Object variable (can only be subsequently defined by Set!)</p>
<p class="Paragraph">[Single]: Single floating-point variable (3.402823 x 10E38 - 1.401298 x 10E-45). If no key word is specified, a variable is defined as Single, unless a statement from DefBool to DefVar was used.</p>
<p class="Paragraph">String: String variable containing a maximum of 64,000 ASCII characters.</p>
<p class="Paragraph">Variant: Variant variable type (can contain all types and is set by definition).</p>
<p class="Paragraph">Variables need not be explicitly declared in <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic. Only arrays must be declared before use. A variable can be <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>declared with the Dim statement; multiple declarations must be separated by commas. To set the type of a variable in the declaration, use either a special type-declaration character appended to the name or the respective key word.</p>
<p class="Paragraph"><help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic uses one-dimensional or multi-dimensional arrays (fields) of given variable types. Arrays are used to edit lists or tables in the program. The advantage of arrays is that you can address individual elements via indices represented as numeric expressions or variables.</p>
<p class="Paragraph">There are two ways to set the range of indices for arrays declared with the Dim statement:</p>
<p class="Paragraph">DIM text(20) As String <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>REM 21 elements numbered from 0 to 20</p>
<p class="Paragraph">DIM text(5 to 25) As String REM 21 elements numbered from 5 to 25</p>
<p class="Paragraph">DIM text$(-15 to 5) As String REM 21 elements (0 inclusive),</p>
<p class="Paragraph">rem numbered from -15 to 5</p>
<p class="Paragraph">Variable fields, regardless of type, can be made dynamic if they are dimensioned by ReDim at procedure level (i.e., in Subs or Functions). Normally the range of an array can be set only once and cant be modified. Within a procedure, an array can be declared by <span class="T1">ReDim</span> using numeric expressions to define the range for the field sizes.</p>
<p class="P2">Example:</p>
<p class="PropText">Sub ExampleRedim</p>
<p class="PropText">Dim iVar() As Integer, iCount As Integer</p>